﻿using System;
using System.ComponentModel;
using System.Runtime.InteropServices;
using Teigha.Core;

namespace Teigha.TD
{
	public class OdAveWoodMaterial : OdAveMaterial
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public OdAveWoodMaterial(IntPtr cPtr, bool cMemoryOwn) : base(TD_DbPINVOKE.OdAveWoodMaterial_SWIGUpcast(cPtr), cMemoryOwn)
		{
			this.swigCPtr = new HandleRef(this, cPtr);
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public static HandleRef getCPtr(OdAveWoodMaterial obj)
		{
			if (obj != null)
			{
				return obj.swigCPtr;
			}
			return new HandleRef(null, IntPtr.Zero);
		}

		~OdAveWoodMaterial()
		{
			this.Dispose();
		}

		public override void Dispose()
		{
			if (this.swigCPtr.Handle != IntPtr.Zero)
			{
				if (this.swigCMemOwn)
				{
					lock (this.locker)
					{
						if (this.swigCPtr.Handle != IntPtr.Zero && this.swigCMemOwn)
						{
							this.swigCMemOwn = false;
							TD_DbPINVOKE.delete_OdAveWoodMaterial(this.swigCPtr);
						}
					}
					this.swigCMemOwn = false;
				}
				this.swigCPtr = new HandleRef(null, IntPtr.Zero);
			}
			GC.SuppressFinalize(this);
			base.Dispose();
		}

		public new static OdAveWoodMaterial cast(OdRxObject pObj)
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr p = TD_DbPINVOKE.OdAveWoodMaterial_cast(OdRxObject.getCPtr(pObj));
			OdAveWoodMaterial result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject((OdAveWoodMaterial)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true));
				result = (OdAveWoodMaterial)Teigha.Core.Helpers.odrxCreateObjectInternal(p, false);
			}
			else
			{
				result = (OdAveWoodMaterial)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true);
			}
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new static OdRxClass desc()
		{
			OdRxClass result = (OdRxClass)Teigha.Core.Helpers.odrxCreateObjectInternal(TD_DbPINVOKE.OdAveWoodMaterial_desc(), false);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual OdRxClass isA()
		{
			OdRxClass result = (OdRxClass)Teigha.Core.Helpers.odrxCreateObjectInternal(TD_DbPINVOKE.OdAveWoodMaterial_isA(this.swigCPtr), false);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual OdRxObject queryX(OdRxClass protocolClass)
		{
			OdRxObject result = Teigha.Core.Helpers.odrxCreateObjectInternal(TD_DbPINVOKE.OdAveWoodMaterial_queryX(this.swigCPtr, OdRxClass.getCPtr(protocolClass)), false);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new static OdAveWoodMaterial createObject()
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr p = TD_DbPINVOKE.OdAveWoodMaterial_createObject();
			OdAveWoodMaterial result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject((OdAveWoodMaterial)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true));
				result = (OdAveWoodMaterial)Teigha.Core.Helpers.odrxCreateObjectInternal(p, false);
			}
			else
			{
				result = (OdAveWoodMaterial)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true);
			}
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual MaterialType type()
		{
			MaterialType result = (MaterialType)TD_DbPINVOKE.OdAveWoodMaterial_type(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public uint lightColor()
		{
			uint result = TD_DbPINVOKE.OdAveWoodMaterial_lightColor(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public uint darkColor()
		{
			uint result = TD_DbPINVOKE.OdAveWoodMaterial_darkColor(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setLightColor(uint lightColor)
		{
			TD_DbPINVOKE.OdAveWoodMaterial_setLightColor(this.swigCPtr, lightColor);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void setDarkColor(uint darkColor)
		{
			TD_DbPINVOKE.OdAveWoodMaterial_setDarkColor(this.swigCPtr, darkColor);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public double lightDark()
		{
			double result = TD_DbPINVOKE.OdAveWoodMaterial_lightDark(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setLightDark(double lightDark)
		{
			TD_DbPINVOKE.OdAveWoodMaterial_setLightDark(this.swigCPtr, lightDark);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public double ringDensity()
		{
			double result = TD_DbPINVOKE.OdAveWoodMaterial_ringDensity(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setRingDensity(double ringDensity)
		{
			TD_DbPINVOKE.OdAveWoodMaterial_setRingDensity(this.swigCPtr, ringDensity);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public double ringWidth()
		{
			double result = TD_DbPINVOKE.OdAveWoodMaterial_ringWidth(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setRingWidth(double ringWidth)
		{
			TD_DbPINVOKE.OdAveWoodMaterial_setRingWidth(this.swigCPtr, ringWidth);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public double ringShape()
		{
			double result = TD_DbPINVOKE.OdAveWoodMaterial_ringShape(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setRingShape(double ringShape)
		{
			TD_DbPINVOKE.OdAveWoodMaterial_setRingShape(this.swigCPtr, ringShape);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public double scale()
		{
			double result = TD_DbPINVOKE.OdAveWoodMaterial_scale(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setScale(double scale)
		{
			TD_DbPINVOKE.OdAveWoodMaterial_setScale(this.swigCPtr, scale);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		private object locker = new object();

		private HandleRef swigCPtr;
	}
}
